<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'HEC HR系统',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.phpexcel.*',
	),

	'defaultController'=>'site/index',

	// application components
	'components'=>array(
		/*
		'db'=>array(
			'connectionString' => 'sqlite:protected/data/blog.db',
			'tablePrefix' => 'tbl_',
		),
		*/
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=hec_uc_backup',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '111111',
			'charset' => 'utf8',
			'tablePrefix' => 'hr_',
			'enableProfiling'=>true,  
			'enableParamLogging'=>true,
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
     		//'caseSensitive'=>false,  
			
			'rules'=>array(
				'gii'=>'gii',
            	'gii/<controller:\w+>'=>'gii/<controller>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				//'<controller:\w+>/<id:\d+>'=>'<controller>/view',
		      	'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
		      	//'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
			
			/*
			'rules'=>array(
		     	'<controller:\w+>/<id:\d+>'=>'<controller>/view',
		      	'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
		      	'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
		      	//'gii'=>'gii',
            	//'gii/<controller:/w+>'=>'gii/<controller>',
            	//'gii/<controller:/w+>/<action:/w+>'=>'gii/<controller>/<action>',
		    ),*/
		    
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// 下面显示页面日志  
				/*
		        array(  
		            'class'=>'CWebLogRoute',  
		            'levels'=>'trace',     //级别为trace  
		            'categories'=>'system.db.*' //只显示关于数据库信息,包括数据库连接,数据库执行语句  
		        ),  
		        */
		        //  toolbar
		        array(  
		            'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',  
		            'ipFilters'=>array('127.0.0.1','192.168.1.215'),  
		        ),  
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'user'=>array(
	        'class'=>'WebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
	    ),
	    'request'=>array(
            'enableCsrfValidation'=>true,
            'enableCookieValidation'=>true,
            //'baseUrl' => 'http://local.hr',
        ),
	),

 	'modules'=>array(
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'111111',
            //'ipFilters'=>array('127.0.0.1','::1'),
            // 'ipFilters'=>array(...a list of IPs...),
            // 'newFileMode'=>0666,
            // 'newDirMode'=>0777,
        ),
        /*
        'userGroups'=>array(
        	'accessCode'=>'111111',
    	)*/
 		'admincp' => array(

 		),
    ),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require(dirname(__FILE__).'/params.php'),
);